
#include "gfx-shader.h"
#include "gfx-mgr.h"

GfxShader::GfxShader(std::string path)
{
    this->_path = path;
    this->_createVertShaderModule();
    this->_createFragShaderModule();
    // this->_createGeomShaderModule();
}
void GfxShader::_createVertShaderModule()
{
    std::vector<char> vertexShaderCode = GfxMgr::getInstance()->readShaderFile(this->_path + ".vert.spv");
    this->_vertShaderModule = GfxMgr::getInstance()->createShaderModule(vertexShaderCode);
}
void GfxShader::_createFragShaderModule()
{
    std::vector<char> fragmentShaderCode = GfxMgr::getInstance()->readShaderFile(this->_path + ".frag.spv");
    this->_fragShaderModule = GfxMgr::getInstance()->createShaderModule(fragmentShaderCode);
}
void GfxShader::_createGeomShaderModule()
{
    std::vector<char> geometryShaderCode = GfxMgr::getInstance()->readShaderFile(this->_path + ".geom.spv");
    this->_geomShaderModule = GfxMgr::getInstance()->createShaderModule(geometryShaderCode);
}
VkShaderModule GfxShader::vertShaderModule()
{
    return this->_vertShaderModule;
}
VkShaderModule GfxShader::fragShaderModule()
{
    return this->_fragShaderModule;
}
VkShaderModule GfxShader::geomShaderModule()
{
    return this->_geomShaderModule;
}

GfxShader::~GfxShader()
{
}
